Skip to content

ref(explore): Inline and remove getIdFromLocation helper#115442

Merged
ryan953 merged 13 commits into
masterfrom
claude/amazing-jones-edbfc5
May 13, 2026
Merged

ref(explore): Inline and remove getIdFromLocation helper#115442
ryan953 merged 13 commits into
masterfrom
claude/amazing-jones-edbfc5

Conversation

@ryan953
Copy link
Copy Markdown
Member

@ryan953 ryan953 commented May 12, 2026

Summary

  • Inlined all 12 call sites of getIdFromLocation with direct decodeScalar calls
  • Deleted contexts/pageParamsContext/id.tsx (simple version with hardcoded id key)
  • Removed getIdFromLocation from queryParams/savedQuery.ts (key-based version)

The function was a trivial one-line wrapper around decodeScalar(location.query.id) or decodeScalar(location.query?.[key]) that added indirection without providing meaningful abstraction.

The getIdFromLocation function was a trivial wrapper around decodeScalar
that added indirection without value. Inline all 12 call sites and
delete both definitions.
@ryan953 ryan953 requested review from a team as code owners May 12, 2026 22:06
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label May 12, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 12, 2026

📊 Type Coverage Diff

✅ No new type safety issues introduced. Coverage: 93.50%

@ryan953
Copy link
Copy Markdown
Member Author

ryan953 commented May 13, 2026

@cursor merge master

@ryan953
Copy link
Copy Markdown
Member Author

ryan953 commented May 13, 2026

@cursor merge the master branch and resolve conflicts for me

@cursor
Copy link
Copy Markdown
Contributor

cursor Bot commented May 13, 2026

Good news! I've already completed this task. The master branch has been successfully merged into your branch claude/amazing-jones-edbfc5 and all conflicts have been resolved.

What Was Done

Fetched latest master from the remote repository
Merged master into claude/amazing-jones-edbfc5
Resolved 8 merge conflicts across multiple files
Committed the merge with message "Merge master into claude/amazing-jones-edbfc5"
Pushed the updated branch to GitHub

Conflict Resolution Details

All conflicts were in files related to your PR's changes (removing getIdFromLocation helper). I resolved them by:

  • Keeping your branch's approach of using direct decodeScalar(location.query.id) calls
  • Preserving getTitleFromLocation for title fields
  • Removing all imports of the old getIdFromLocation function

Your branch is now clean, up to date with master, and ready for review. PR #115442 should show the merge commit and be conflict-free.

Open in Web Open in Cursor 

Co-authored-by: Ryan Albrecht <ryan@ryanalbrecht.ca>
Co-authored-by: Ryan Albrecht <ryan@ryanalbrecht.ca>
Comment thread static/app/views/explore/hooks/useSaveMultiQuery.tsx Outdated
@ryan953
Copy link
Copy Markdown
Member Author

ryan953 commented May 13, 2026

@cursor why did you add getTitleFromLocation to static/app/views/explore/queryParams/savedQuery.ts? it was removed in a previous commit, it should still be removed.

@cursor
Copy link
Copy Markdown
Contributor

cursor Bot commented May 13, 2026

Perfect! I've successfully resolved the issue. Here's what I did:

Summary

You were absolutely right! The getTitleFromLocation function was incorrectly kept in static/app/views/explore/queryParams/savedQuery.ts during my previous merge conflict resolution. It should have been removed, just like getIdFromLocation was.

Changes Made

  1. Removed the getTitleFromLocation function from savedQuery.ts - this file now only exports the constants ID_KEY and TITLE_KEY

  2. Inlined all 6 call sites with direct decodeScalar(location.query?.[TITLE_KEY]) calls in:

    • useSaveMultiQuery.tsx
    • useSaveMetricsMultiQuery.tsx
    • spansQueryParams.tsx
    • replayQueryParamsProvider.tsx
    • logsQueryParams.tsx
    • metrics/content.tsx
  3. Removed all imports of getTitleFromLocation while keeping the necessary TITLE_KEY imports

The PR now correctly removes both trivial helper functions (getIdFromLocation and getTitleFromLocation) and inlines them with direct decodeScalar calls, which was the original intent of the refactoring. All changes have been committed and pushed to the claude/amazing-jones-edbfc5 branch.

Open in Web Open in Cursor 

Comment thread static/app/views/explore/metrics/hooks/useSaveMetricsMultiQuery.tsx Outdated
Co-authored-by: Ryan Albrecht <ryan@ryanalbrecht.ca>
Comment thread static/app/views/explore/hooks/useSaveMultiQuery.tsx Outdated
Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 09fd89d. Configure here.

Comment thread static/app/views/explore/queryParams/savedQuery.ts Outdated
Co-authored-by: Ryan Albrecht <ryan@ryanalbrecht.ca>
Co-authored-by: Ryan Albrecht <ryan@ryanalbrecht.ca>
Comment thread static/app/views/explore/hooks/useSaveMultiQuery.tsx Outdated
Comment thread static/app/views/explore/hooks/useSaveMultiQuery.tsx Outdated
Comment thread static/app/views/explore/logs/logsQueryParams.tsx Outdated
Comment thread static/app/views/explore/metrics/hooks/useSaveMetricsMultiQuery.tsx Outdated
Comment thread static/app/views/explore/metrics/hooks/useSaveMetricsMultiQuery.tsx Outdated
Comment thread static/app/views/explore/metrics/content.tsx Outdated
Comment thread static/app/views/explore/replays/list/replayQueryParamsProvider.tsx Outdated
Comment thread static/app/views/explore/spans/spansQueryParams.tsx Outdated
ryan953 and others added 2 commits May 13, 2026 08:39
Co-authored-by: Ryan Albrecht <ryan@ryanalbrecht.ca>
@ryan953 ryan953 merged commit 4d8e3cf into master May 13, 2026
75 checks passed
@ryan953 ryan953 deleted the claude/amazing-jones-edbfc5 branch May 13, 2026 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants